import axios from 'axios'

export const LogTypeService = class LogTypeService {
    static logTypeService = null
    requestUrl = 'http://localhost/logTypes'

    static getInstance() {
        if (this.logTypeService == null) {
            this.logTypeService = new LogTypeService()
        }
        return this.logTypeService
    }

    /**
     * 查询父类型
     */
    getParentList() {
        return axios.get(`${this.requestUrl}`)
    }

    /**
     * 根据父类型查询
     * @param pid
     */
    getByParent(pid) {
        return axios.get(`${this.requestUrl}/parent/${pid}`)
    }

    /**
     * 获取级联数据
     */
    getCascader() {
        return axios.get(`${this.requestUrl}/cascader`)
    }
}
